package com.totoro.service;

import com.totoro.pojo.MyHistory;
import com.totoro.pojo.User;
import com.totoro.pojo.UserOnline;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author TOTORO
 * @date 2021/4/29 17:02
 * 处理用户事物方法，注册、登录
 */
public interface UserService {
    /**
     * 查询所有会员
     * @return
     * @throws Exception
     */
    List<User> findAllUser();

    User findUserById(int uid);

    List<User> userNameTest(String name);

    int addUser(User user);

    List<User> userInfoToPhone(String phone);

    User checkUser(String value);

    int updateUser(User user);

    int updatePassword(String value, String password, String salt);

    User findUser(int uid);

    // 用户信息操作 //

    String saveUserDataByUid(MultipartFile file, User user, HttpServletRequest request, HttpSession session) throws IOException;

    Map<String, List<MyHistory>> findUserHistory(int uid);

    Integer addMyHistory(MyHistory myHistory);

    MyHistory repeatHistory(int uid,int pid);

    Integer deleteHistory(int mhId);

    Integer addUserOnlineCount(int uid);

    UserOnline findDayUserOnline(UserOnline userOnline);

    Integer addUserScore(int uid, int score);

    Integer deleteUser(int uid);

    Integer untieUserBan(int uid);
}
